@extends('admin.layouts.app')
@section('content')

                        <!-- Page-Title -->
                        <div class="row">
                            <div class="col-sm-12">
                                <h4 class="page-title">服务项目管理</h4>
                                <ol class="breadcrumb">
                                    <li><a href="{{url('zadmin/')}}">系统</a></li>
                                    <li><a href="{{url('zadmin/services')}}">服务项目</a></li>
                                    <li class="active">修改服务项目</li>
                                </ol>
                            </div>
                        </div>
                        
                        <div class="row">
                        	<div class="col-lg-12">
                        		<div class="card-box">
                            <h2 class="m-t-0 header-title">修改服务项目</h2>
                            <hr/>
                             @if(session('rs'))
                              <div class="alert alert-{{session('rs')['status']}}">
                                {{ session('rs')['msg'] }}
                              </div>
                              @endif
                        			<div class="row">
			                        	<div class="col-md-12">
                                  <form class="form-horizontal" role="form" action="{{url('zadmin/services')}}" method="post" >

                                              <div class="form-group col-md-6">
                                                  <label class="col-md-3 control-label">项目名称</label>
                                                  <div class="col-md-9">
                                                      <input type="text" class="form-control" name="name" required="" value="{{old('name')}}">
                                                  </div>
                                              </div>
                                              <div class="form-group col-md-6">
                                                  <label class="col-md-3 control-label">项目类别</label>
                                                  <div class="col-md-9">
                                                      <select class="form-control" name="service_type_id" required="">
                                                        <option value="">请选择项目类别</option>
                                                        @foreach($types as $t)
                                                        <option value="{{$t->id}}">{{$t->name}}</option>
                                                        @endforeach
                                                      </select>
                                                  </div>
                                              </div>
                                              <div class="form-group col-md-6">
                                                  <label class="col-md-3 control-label">定价方式</label>
                                                  <div class="col-md-9">
                                                      <select class="form-control" name="price_type" required="" id="price_type">
                                                        <option value="1">作业定价</option>
                                                        <option value="2">工时定价</option>
                                                      </select>
                                                  </div>
                                              </div>
                                              <div class="form-group col-md-6 zuoye">
                                                  <label class="col-md-3 control-label">项目价格</label>
                                                  <div class="col-md-9">
                                                      <input type="text" class="form-control" name="price"  value="{{old('price')}}">
                                                  </div>
                                              </div>
                                            <div class="col-md-12 gongshi" style="display: none">  
                                              <div class="form-group col-md-6 ">
                                                  <label class="col-md-3 control-label">标准工时</label>
                                                  <div class="col-md-9">
                                                      <input type="text" class="form-control" name="gongshi"  value="{{old('gongshi')}}">
                                                  </div>
                                              </div>

                                              <div class="form-group col-md-6 ">
                                                  <label class="col-md-3 control-label">工时单价</label>
                                                  <div class="col-md-9">
                                                      <div class="input-group m-t-10">
                                <input type="text" name="gongshi_fee" class="form-control" value="{{old('gongshi_fee')}}" />
                                                        <span class="input-group-btn">
                                                        <button type="button" class="btn waves-effect waves-light btn-primary">元/小时</button>
                                                        </span>
                                                    </div>
                                                  </div>
                                              </div>


                                          </div>                                                                       
                                              <div class="form-group col-md-6">
                                                  <label class="col-md-3 control-label">成本价格</label>
                                                  <div class="col-md-9">
                                                      <input class="form-control" name="base_price" value="{{old('base_price')}}" />
                                                  </div>
                                              </div>
                                              <div class="form-group col-md-6">
                                                  <label class="col-md-3 control-label">备注</label>
                                                  <div class="col-md-9">
                                                      <input type="text" class="form-control" name="remark"  value="{{old('remark')}}">
                                                  </div>
                                              </div>

                                              <div class="form-group text-center col-md-12">
                                                  
                                                  <button type="submit" class="btn btn-info waves-effect waves-light">保存</button>
                                              </div>
                                              
                                              
                             {{csrf_field()}}
                                          </form>
                                </div>
			                        	
			                        </div>

                             
			                        
                        			
                        		</div>
                                
                            </div> <!-- end col -->

                            
                        </div>
@endsection
                        
                        
                        

                  
            
    @section('modal')        
        <!-- Modal -->
      
    @endsection        
       

           



    
        @section('js')
<script type="text/javascript">
         

          $('#price_type').on('change',function(){
            var _val = $(this).val();
            //alert(_val);
            if(_val==2) {
              $('.gongshi').show();
              $('.zuoye').hide();
            }else{
              $('.zuoye').show();
              $('.gongshi').hide();
            }
          });
        </script>
        @endsection
    
